<?php
class LoginView extends View
{
	public function DoLoginBox()
	{
		$this->Markup( '<form action="#" method="POST">' . "\r\n" );
		$this->Markup( '  <fieldset>' . "\r\n" );
		$this->Markup( '    <label for"username">Username:</label>' . "\r\n" );
		$this->Markup( '    <input type="text" name="username" id="username" />' . "\r\n" );
		
		$this->Markup( '    <label for"password">Password:</label>' . "\r\n" );
		$this->Markup( '    <input type="password" name="password" id="password" />' . "\r\n" );
		
		$this->Markup( '    <input type="submit" name="login" id="login" value="Log in" />' . "\r\n" );
		$this->Markup( '  </fieldset>' . "\r\n" );
		$this->Markup( '</form>' . "\r\n" );
	}

	public function TriedToLogIn()
	{
		return isset( $_POST['login'] ) ? $_POST['login'] : NULL;	
	}
	
	public function TriedToLogout()
	{
		return isset( $_GET['a'] ) && $_GET['a'] == "logout" ? true : false;
	}
	
	public function GetUsername()
	{
		return isset( $_POST['username'] ) ? $_POST['username'] : NULL;
	}
	
	public function GetPassword()
	{
		return isset( $_POST['password'] ) ? $_POST['password'] : NULL;
	}
}
